/*
 * @Author: wuqingchun
 * @Date: 2025-01-21 17:44:41
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2025-01-21 17:57:30
 */
#include "rpc_service.h"

int32_t RpcService::Call(const RpcRequest& refRequest, RpcReply& refReply)
{
    refReply.iFuncID = refRequest.iFuncID;
    refReply.iErr = 0;

    if (refRequest.iFuncID == FUNC_ID_ADD)
    {
        refReply.iResult = refRequest.iArg1 + refRequest.iArg2;
    }
    else if (refRequest.iFuncID == FUNC_ID_SUB)
    {
        refReply.iResult = refRequest.iArg1 - refRequest.iArg2;
    }
    else
    {
        refReply.iErr = -1;
    }

    return refReply.iErr;
}

